<template>
  <basic-dialog
    width="40%"
    title="选择开发类型"
    :visible="visible"
    :handleClose="handleClose"
  >
    <el-radio-group v-model="radioGroup.value">
        <el-radio
          v-for="item in radioGroup.options"
          :key="item.value"
          :label="item.value"
        >{{ item.label }}
        </el-radio>
      </el-radio-group>
    <div slot="ft" class="footer-wrap">
      <el-button type="primary" @click="handleOk">确定</el-button>
      <el-button @click="handleClose">取消</el-button>
    </div>
  </basic-dialog>
</template>
<script>
import BasicDialog from '@/components/BasicDialog';
import LabelSelect from '@/pages/commodity/components/LabelSelect';
import { LATENT_DEV_TYPES_OPTIONS } from '@/pages/commodity/developRequirementPlan/developRequirementPool/constants/latentAdd';
export default {
  components: {
    BasicDialog,
    LabelSelect
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
  },
  data () {
    return {
      radioGroup: {
        value: '',
        options: LATENT_DEV_TYPES_OPTIONS
      }
    }
  },
  methods: {
    // 确定
    handleOk () {
      if (!this.radioGroup.value) return this.$message.warning('请选择开发类型')
      this.$emit('getDevType', this.radioGroup.value)
      this.handleClose()
    },
    // 取消
    handleClose () {
      this.$emit('update:visible', false)
    },
  }
}
</script>
<style lang="less" scoped>
/deep/ .el-radio-group {
  .el-radio {
    width: 100%;
    &:not(:first-child) {
      margin-top: 20px;
    }
  }
}
</style>
